
/* tech_news_aggregator/frontend/css/news-style.css */

/* ===== 基础变量 ===== */
:root {
  --primary-color: #3B82F6;
  --secondary-color: #60A5FA;
  --success-color: #10B981;
  --warning-color: #FBBF24;
  --danger-color: #EF4444;
  --info-color: #6366F1;
  
  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;
  
  --bg-primary: #F5F7FA;
  --bg-secondary: #E5E7EB;
  --bg-card: rgba(255, 255, 255, 0.9);
  
  --border-color: #E2E8F0;
  --border-radius: 12px;
  
  --transition-speed: 0.3s;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  --box-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ===== 暗黑模式变量 ===== */
.dark-mode {
  --primary-color: #3B82F6;
  --secondary-color: #60A5FA;
  --success-color: #10B981;
  --warning-color: #FBBF24;
  --danger-color: #EF4444;
  --info-color: #6366F1;
  
  --text-primary: #F9FAFB;
  --text-secondary: #E5E7EB;
  --text-muted: #9CA3AF;
  
  --bg-primary: #1A1A2E;
  --bg-secondary: #16213E;
  --bg-card: rgba(26, 32, 44, 0.9);
  
  --border-color: #2D3748;
  --box-shadow: 0 4px(0, 0, 0, 0.2);
  --box-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* ===== 全局设置 ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: var(--text-primary);
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  min-height: 100vh;
  transition: background var(--transition-speed) ease, color var(--transition-speed) 
  padding: 0;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== 布局容器 ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== 标题样式 ===== */
header {
  padding: 2rem 0;
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

header p {
  color: var(--text-secondary);
  font-size: 1.125rem;
}

/* ===== 过滤栏样式 ===== */
.filter-bar {
  background-color: var(--bg-card);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  border: none;
  outline: none;
}

.filter-btn:hover {
  opacity: 0.9;
}

.filter-btn.active {
  box-shadow: 0 0 0 2px var(--primary-color);
}

.search-container {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-container input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  border-radius: 99(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: all var(--transition-speed) ease;
}

.search-container input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ===== 新闻卡片样式 ===== */
.news-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.news-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: all var(--transition-speed) ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-hover);
}

.news-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-meta {
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.news-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.news-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.news-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.news-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.news-title a:hover {
  color: var(--primary-color);
}

.news-summary {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  flex: 1;
}

.news-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.news-source {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.news-actions {
  display: flex;
  gap: 0.5rem;
}

.news-actions button {
  background: none;
  border: none;
  c color var(--transition-speed) ease;
  padding: 0.25rem;
  font-size: 0.875rem;
}

.news-actions button:hover {
  color: var(--primary-color);
}

/* ===== 关键词标签 ===== */
.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.keyword {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
  padding: 0.25rem 0.5rem;
  border-ra
  text-align: center;
  padding: 3rem 0;
}

.loading-spinner {
  display: inline-block;
  width: 2rem;
  height: 2rem;
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
};
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-speed) ease;
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* ===== 暗色模式切换按钮 ===== */
.mode-toggle {
  background-color: var(--bg-secondary);
  border: none;
  color: var(--text-primary);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
transition: all var(--transition-speed) ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mode-toggle:hover {
  background-color: var(--border-color);
}

/* ===== 高亮搜索结果 ===== */
.highlight {
  background-color: var(--warning-color);
  color: #000;
  padding: 0 2px;
  border-radius: 2px;
}

/* ===== 分类颜色 ===== */
.category-ai {
  background-color: rgba(139, 92, 246, 0.1);
  color: #8B5CF6;
}

.category-blockchain {
 , 185, 129, 0.1);
  color: #10B981;
}

.category-biotech {
  background-color: rgba(239, 68, 68, 0.1);
  color: #EF4444;
}

.category-hardware {
  background-color: rgba(245, 158, 11, 0.1);
  color: #F59E0B;
}

.category-internet {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3B82F6;
}

.category-other {
  background-color: rgba(107, 114, 128, 0.1);
  color: #6B7280;
}

. #A78BFA;
}

.dark-mode .category-blockchain {
  background-color: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.dark-mode .category-biotech {
  background-color: rgba(239, 68, 68, 0.2);
  color: #F87171;
}

.dark-mode .category-hardware {
  background-color: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
}

.dark-mode .category-internet {
  background-color: rgba(59, 130, 246, 0.2);
  color: #60A5FA;
}

.dark-mode .category-other {
  background-color: rgba(107, 114, 128, 0.2);
  color: #9CA3AF;
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
  .news-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-buttons {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    justify-content: flex-start;
    width: 100%;
  }
  
  .search-container {
    max-width: none;
  }
  
  h1 {
    font-size: 2rem;
  } 640px) {
  .news-container {
    grid-template-columns: 1fr;
  }
  
  .news-card {
    max-width: 100%;
  }
  
  header {
    padding: 1.5rem 0;
  }
  
  h1 {
    font-size: 1.75rem;
  }
}

/* ===== 粒子效果背景 ===== */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -1;
}

/* ===== 无结果提示 ===== */
.no-results {
  text-align: center;
  p: 3rem 0;
  color: var(--text-secondary);
}

/* ===== 微交互动效 ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 卡片内容渐显效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: trans ease forwards;
  opacity: 0;
  animation-fill-mode: both;
}

/* 错开动画延迟 */
.news-card:nth-child(1) { animation-delay: 0.05s; }
.news-card:nth-child(2) { animation-delay: 0.1s; }
.news-card:nth-child(3) { animation-delay: 0.15s; }
.news-card:nth-child(4) { animation-delay: 0.2s; }
.news-card:nth-child(5) { animation-delay: 0.25s; }
.news-card:nth-child(6) { animation-delay: 0.3s; }

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ===== 可访问性增强 ===== */
.visually-hidden {
  position: absolute !important;
  height: 1pxpx, 1px, 1px, 1px);
  white-space: nowrap;
}

/* 焦点状态增强 */
a:focus, button:focus, input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* 打印样式优化 */
@media print {
  body {
    background: none !important;
    color: #000 !important;
  }
  
  .news-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
  
  .filter-bar, .mode-toggle, .news-actions, footer {
    display: none !important;
  }
}
